﻿#include<iostream>
#include<list>

using namespace std;

int main()
{
	int ar[] = { 0,1, 2, 3, 4,  5, 6, 7, 8, 9 };

	int n = sizeof(ar) / sizeof(int);

	list<int> mylist(ar, ar + n);

	list<int>::iterator pos = find(mylist.begin(), mylist.end(), 5);

	reverse(mylist.begin(), pos);//反转范围前闭后开

	reverse(pos, mylist.end());


	list<int>::const_reverse_iterator crit = mylist.crbegin();

	while (crit != mylist.crend())
	{

		cout << *crit << " ";

		++crit;

	}

	cout << endl;
	return 0;
}